package com.ostrich.demonavigation

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.findNavController
import androidx.navigation.ui.setupWithNavController
import com.google.android.material.bottomnavigation.BottomNavigationView

class MainActivity : AppCompatActivity() {
    lateinit var bottomNavigationView: BottomNavigationView


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        //navController
        val findNavController = findNavController(R.id.nav_host_fragment)
        //底部导航
        bottomNavigationView = findViewById(R.id.bottom_view)
        //二者联动
        bottomNavigationView.setupWithNavController(findNavController)
    }
}